<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ADC: VREF Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ADC
   &#160;<span id="projectnumber">9.2</span>
   </div>
   <div id="projectbrief">Analog to Digital Conversor library for the Teensy 3.5 microprocessor</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('namespace_v_r_e_f.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">VREF Namespace Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Controls the Teensy internal voltage reference module (VREFV1)  
<a href="namespace_v_r_e_f.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a569b07fd4d9cba8e5c6cb170b952c7ef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#a569b07fd4d9cba8e5c6cb170b952c7ef">start</a> (uint8_t mode=VREF_SC_MODE_LV_HIGHPOWERBUF, uint8_t <a class="el" href="namespace_v_r_e_f.html#adf9a5a3b3d7140ad45019141c2f054b4">trim</a>=0x20)</td></tr>
<tr class="memdesc:a569b07fd4d9cba8e5c6cb170b952c7ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start the 1.2V internal reference (if present) This is called automatically by ADC_Module::setReference(ADC_REFERENCE::REF_1V2) Use it to switch on the internal reference on the VREF_OUT pin. You can measure it with adc-&gt;analogRead(ADC_INTERNAL_SOURCE::VREF_OUT).  <a href="namespace_v_r_e_f.html#a569b07fd4d9cba8e5c6cb170b952c7ef">More...</a><br /></td></tr>
<tr class="separator:a569b07fd4d9cba8e5c6cb170b952c7ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf9a5a3b3d7140ad45019141c2f054b4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#adf9a5a3b3d7140ad45019141c2f054b4">trim</a> (uint8_t trim)</td></tr>
<tr class="memdesc:adf9a5a3b3d7140ad45019141c2f054b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the trim The change in the reference is about 0.5 mV per step.  <a href="namespace_v_r_e_f.html#adf9a5a3b3d7140ad45019141c2f054b4">More...</a><br /></td></tr>
<tr class="separator:adf9a5a3b3d7140ad45019141c2f054b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac667e62e25fd2c9325f73dd0c6a6a3e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#ac667e62e25fd2c9325f73dd0c6a6a3e8">stop</a> ()</td></tr>
<tr class="memdesc:ac667e62e25fd2c9325f73dd0c6a6a3e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the internal reference.  <a href="namespace_v_r_e_f.html#ac667e62e25fd2c9325f73dd0c6a6a3e8">More...</a><br /></td></tr>
<tr class="separator:ac667e62e25fd2c9325f73dd0c6a6a3e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a17a24c68ffc761a61750dd5c207336"><td class="memItemLeft" align="right" valign="top">volatile bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#a7a17a24c68ffc761a61750dd5c207336">isStable</a> ()</td></tr>
<tr class="memdesc:a7a17a24c68ffc761a61750dd5c207336"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the internal reference has stabilized. NOTE: This is valid only when the chop oscillator is not being used. By default the chop oscillator IS used, so wait the maximum start-up time of 35 ms (as per datasheet). waitUntilStable waits 35 us. This should be polled after enabling the reference after reset, after changing its buffer mode from VREF_SC_MODE_LV_BANDGAPONLY to any of the buffered modes, or after changing the trim.  <a href="namespace_v_r_e_f.html#a7a17a24c68ffc761a61750dd5c207336">More...</a><br /></td></tr>
<tr class="separator:a7a17a24c68ffc761a61750dd5c207336"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1becdab4311ae08f2eb56e2542e9eb1"><td class="memItemLeft" align="right" valign="top">volatile bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#ab1becdab4311ae08f2eb56e2542e9eb1">isOn</a> ()</td></tr>
<tr class="memdesc:ab1becdab4311ae08f2eb56e2542e9eb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the internal reference is on.  <a href="namespace_v_r_e_f.html#ab1becdab4311ae08f2eb56e2542e9eb1">More...</a><br /></td></tr>
<tr class="separator:ab1becdab4311ae08f2eb56e2542e9eb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a108f7c1b5a2073bc092eafcae58575b0"><td class="memItemLeft" align="right" valign="top"><a id="a108f7c1b5a2073bc092eafcae58575b0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_v_r_e_f.html#a108f7c1b5a2073bc092eafcae58575b0">waitUntilStable</a> ()</td></tr>
<tr class="memdesc:a108f7c1b5a2073bc092eafcae58575b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for the internal reference to stabilize. This function can be called to wait for the internal reference to stabilize. It will block until the reference has stabilized, or return immediately if the reference is not enabled in the first place. <br /></td></tr>
<tr class="separator:a108f7c1b5a2073bc092eafcae58575b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Controls the Teensy internal voltage reference module (VREFV1) </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ab1becdab4311ae08f2eb56e2542e9eb1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1becdab4311ae08f2eb56e2542e9eb1">&#9670;&nbsp;</a></span>isOn()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile bool VREF::isOn </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if the internal reference is on. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the <a class="el" href="namespace_v_r_e_f.html" title="Controls the Teensy internal voltage reference module (VREFV1)">VREF</a> module is switched on. </dd></dl>

<p class="definition">Definition at line <a class="el" href="_v_r_e_f_8h_source.html#l00113">113</a> of file <a class="el" href="_v_r_e_f_8h_source.html">VREF.h</a>.</p>

</div>
</div>
<a id="a7a17a24c68ffc761a61750dd5c207336"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a17a24c68ffc761a61750dd5c207336">&#9670;&nbsp;</a></span>isStable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile bool VREF::isStable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if the internal reference has stabilized. NOTE: This is valid only when the chop oscillator is not being used. By default the chop oscillator IS used, so wait the maximum start-up time of 35 ms (as per datasheet). waitUntilStable waits 35 us. This should be polled after enabling the reference after reset, after changing its buffer mode from VREF_SC_MODE_LV_BANDGAPONLY to any of the buffered modes, or after changing the trim. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the <a class="el" href="namespace_v_r_e_f.html" title="Controls the Teensy internal voltage reference module (VREFV1)">VREF</a> module is already in a stable condition and can be used. </dd></dl>

<p class="definition">Definition at line <a class="el" href="_v_r_e_f_8h_source.html#l00105">105</a> of file <a class="el" href="_v_r_e_f_8h_source.html">VREF.h</a>.</p>

</div>
</div>
<a id="a569b07fd4d9cba8e5c6cb170b952c7ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a569b07fd4d9cba8e5c6cb170b952c7ef">&#9670;&nbsp;</a></span>start()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VREF::start </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>mode</em> = <code>VREF_SC_MODE_LV_HIGHPOWERBUF</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>trim</em> = <code>0x20</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Start the 1.2V internal reference (if present) This is called automatically by ADC_Module::setReference(ADC_REFERENCE::REF_1V2) Use it to switch on the internal reference on the VREF_OUT pin. You can measure it with adc-&gt;analogRead(ADC_INTERNAL_SOURCE::VREF_OUT). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td>can be (these are defined in kinetis.h) VREF_SC_MODE_LV_BANDGAPONLY (0) for stand-by VREF_SC_MODE_LV_HIGHPOWERBUF (1) for high power buffer and VREF_SC_MODE_LV_LOWPOWERBUF (2) for low power buffer. </td></tr>
    <tr><td class="paramname">trim</td><td>adjusts the reference value, from 0 to 0x3F (63). Default is 32. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_v_r_e_f_8h_source.html#l00056">56</a> of file <a class="el" href="_v_r_e_f_8h_source.html">VREF.h</a>.</p>

</div>
</div>
<a id="ac667e62e25fd2c9325f73dd0c6a6a3e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac667e62e25fd2c9325f73dd0c6a6a3e8">&#9670;&nbsp;</a></span>stop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VREF::stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Stops the internal reference. </p>
<p>This his is called automatically by ADC_Module::setReference(ref) when ref is any other than REF_1V2 </p>

<p class="definition">Definition at line <a class="el" href="_v_r_e_f_8h_source.html#l00088">88</a> of file <a class="el" href="_v_r_e_f_8h_source.html">VREF.h</a>.</p>

</div>
</div>
<a id="adf9a5a3b3d7140ad45019141c2f054b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf9a5a3b3d7140ad45019141c2f054b4">&#9670;&nbsp;</a></span>trim()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VREF::trim </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>trim</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the trim The change in the reference is about 0.5 mV per step. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">trim</td><td>adjusts the reference value, from 0 to 0x3F (63). </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_v_r_e_f_8h_source.html#l00077">77</a> of file <a class="el" href="_v_r_e_f_8h_source.html">VREF.h</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_v_r_e_f.html">VREF</a></li>
    <li class="footer">Generated on Tue Nov 29 2022 23:16:23 for ADC by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
